<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <title>推荐会员</title>
</head>
<body style="color: #00aaaa">
    <div class="container">
        <center><h2>积分提现</h2></center>
        <div><b>{$_info.name}</b>您好,您当前可用积分：<span style="color: red">{$_info.integral}</span>。可提现金额：<span style="color: red">{$money}</span></div>
    </div>
    <div class="form-group" style="margin-top: 50px;">
        <label for="name">兑换分数</label>
        <input type="number" class="form-control" id="integral" placeholder="请输入要兑换的积分数量" name="integral">
    </div>
    <button class="btn btn-info btn-block" type="submit" id="submit">兑换</button>
    <script>
        $('#submit').click(function(){
            if($('#integral').val() == 0) {
                alert('最少兑换1积分!');return;
            }
            $.post("{:U('Mall/apply')}",{'integral':$('#integral').val()},function(data){
                if (data.reg === 1) {
                    alert(data.info);
                    WeixinJSBridge.call('closeWindow');
                } else {
                    alert(data.info);
                }
            });
        });
    </script>
</body>
</html>